< previous page page_331 next page >

Page 331
8160-0331a.gif
Figure 16.9
The Add Watch variable.
analysis.gifWatching variables is a great way to see when variable values change.

Besides just setting a watch variable, you may want to enter an expression in the text box. This allows you to test that expression. Table 16.1 provides an explanation for each of the options you may select in the Add Watch window.
Table 16.1 Watch Types.
OptionDescription
ExpressionThis can be any valid Visual Basic expression. It can be a variable name, or you can test to see whether a variable is equal to a certain value.
ContextYou can tell Visual Basic which variable to watcha local, form/module-level, or global variable.
Watch TypeYou can determine when to enter break mode by selecting the Break When Value Is True option. For example, enter the following in the Expression text box:
gintValue = 10
Once the value in the variable gintValue becomes 10, Visual Basic automatically puts you in break mode. You can then see the line where this change occurred.
You can tell Visual Basic to stop execution anytime the value in a variable changes by selecting the Break When Value Changes option. This is particularly useful for testing which routines change a global or module-level variable.

 
< previous page page_331 next page >

If you like this book, buy it!